import request from '@/utils/request'

// 获取轮播图列表
export function getBannerList(data) {
  return request({
    url: '/banners',
    method: 'get',
    query: { pageNumber: data.pageNumber, pageSize: data.pageSize }
  })
}

// 新增轮播图
export function addBanner(params) {
  return request({
    url: '/banners',
    method: 'post',
    'Content-Type': 'multipart/form-data',
    data: params
  })
}

// 修改轮播图
export function editBanner(id, params) {
  return request({
    url: `/banners/${id}`,
    method: 'put',
    'Content-Type': 'multipart/form-data',
    data: params
  })
}

// 删除轮播图
export function deleteBanner(id) {
  return request({
    url: `/banners/${id}`,
    method: 'delete'
  })
}

// 是否启用轮播图
export function isUseBanner(params) {
  return request({
    url: '/banners/isuse',
    method: 'post',
    data: params
  })
}
